<template>
	<view class="container">
		<view class="join-form">
			<view class="form-title">我想要加入球队！</view>
			
			<textarea class="join-message" 
				v-model="message" 
				placeholder="请输入申请理由..." 
				:maxlength="200"
				auto-height>
			</textarea>
			
			<button class="submit-btn" @tap="submitApplication">提交申请</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				teamId: '',
				message: ''
			}
		},
		onLoad(options) {
			if (options.teamId) {
				this.teamId = options.teamId
			}
		},
		methods: {
			submitApplication() {
				if (!this.message.trim()) {
					uni.showToast({
						title: '请输入申请理由',
						icon: 'none'
					})
					return
				}
				
				// TODO: 调用申请加入API
				uni.showLoading({
					title: '提交中...'
				})
				
				// 模拟API调用
				setTimeout(() => {
					uni.hideLoading()
					uni.showToast({
						title: '申请已提交',
						icon: 'success'
					})
					setTimeout(() => {
						uni.navigateBack()
					}, 1500)
				}, 1000)
			}
		}
	}
</script>

<style>
	.container {
		padding: 30rpx;
		min-height: 100vh;
		background-color: #f5f5f5;
	}
	
	.join-form {
		background-color: #fff;
		border-radius: 12rpx;
		padding: 40rpx;
	}
	
	.form-title {
		font-size: 36rpx;
		font-weight: bold;
		color: #333;
		margin-bottom: 40rpx;
		text-align: center;
	}
	
	.join-message {
		width: 100%;
		min-height: 200rpx;
		background-color: #f8f8f8;
		border-radius: 8rpx;
		padding: 20rpx;
		font-size: 28rpx;
		color: #333;
		margin-bottom: 40rpx;
	}
	
	.submit-btn {
		background-color: #ff6b35;
		color: #fff;
		border-radius: 44rpx;
		font-size: 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		margin-top: 60rpx;
	}
</style> 